﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace MailServer.Message {
    /// <summary>
    /// Almacena el Remitente y destinatario del correo
    /// </summary>
    [Serializable]
    public class FromTo {
        private string from;
        private string to;
        /// <summary>
        /// Constructor
        /// </summary>
        /// <param name="from">Remitente</param>
        /// <param name="to">Destinatario</param>
        public FromTo(string from, string to) {
            this.from = from;
            this.to = to;
        }

        public bool CheckTo(string to) {
            return this.to == to;
        }

        public bool CheckFrom(string from) {
            return this.from == from;
        }

        public override string ToString() {
            return "From: " + from + Environment.NewLine +
                   "To:" + to;
        }
    }
}
